﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/index.Master" CodeBehind="PridatGalerii.aspx.cs" Inherits="Fotobanka.PridatGalerii" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Obsah" runat="server">
    <center>
        <h1>Přidání nové galerie</h1>
        <br />
        <asp:ValidationSummary ID="shrnuti" runat="server" DisplayMode="List" />
        <br />
        <table>
            <tr><td class="style1" align="left">
                <asp:Label ID="Label1" runat="server" Text="Jméno galerie: *"></asp:Label>
                </td><td>
                    <asp:TextBox ID="jmeno" runat="server" BorderColor="Black" BorderWidth="1px"></asp:TextBox>
                </td></tr>
            <tr><td class="style1" align="left">
                <asp:Label ID="Label2" runat="server" Text="Popis galerie:"></asp:Label>
                </td><td>
                    <asp:TextBox ID="popis" runat="server" BorderColor="Black" BorderWidth="1px"></asp:TextBox>
                </td></tr>
            <tr><td class="style1" align="left">
                <asp:Label ID="Label4" runat="server" Text="Spravce galerie:"></asp:Label>
                </td><td>
                    
                    <asp:DropDownList ID="spravce" runat="server" DataSourceID="ObjectDataSource1" 
                        DataTextField="Email" DataValueField="Id" style="margin-left: 0px">
                    </asp:DropDownList>
                    
                </td></tr>
            <tr><td class="style1" align="left">
                <asp:Label ID="Label3" runat="server" Text="Skryta"></asp:Label>
                </td><td>
                    <asp:CheckBox ID="skryta" runat="server" />
                </td></tr>
        </table>
        Položky označené hvezdičkou jsou povinné.
        <br />
        <asp:Button ID="addButton" runat="server" Text="Přidat" 
            BorderColor="Black" BorderWidth="1px" onclick="addButton_Click" />
        <br />
        <asp:RequiredFieldValidator ID="jmenoReqValidator" runat="server" 
            ControlToValidate="jmeno" Display="None" 
            ErrorMessage="Není vyplněno jméno galerie"></asp:RequiredFieldValidator>
        <asp:CustomValidator ID="jmenoDupliValidator" runat="server" 
            ControlToValidate="jmeno" Display="None" 
            ErrorMessage="Taková galerie již existuje" 
            onservervalidate="jmenoDupliValidator_ServerValidate"></asp:CustomValidator>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="UsersListSpravcuIseSebou" TypeName="Fotobanka.UserManager">
        </asp:ObjectDataSource>
        <br />
    </center>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Ovladaci_panel" runat="server">
</asp:Content>